package com.hengpeng.msls.dao;

import java.util.Date;
import java.util.List;

import com.hengpeng.common.persist.NestedSimplyDao;
import com.hengpeng.itfinbase.en.RewardRedPacketStatus;
import com.hengpeng.itfinbase.persist.RewardRedpacket;

public interface RedPacketDao extends NestedSimplyDao<RewardRedpacket> {
    /**
     * 根据状态获取红包
     * 
     * @param status
     * @return
     */
    public List<RewardRedpacket> findRedPacketByStatus(RewardRedPacketStatus status, int fetchSize);

    /**
     * 更新红包状态
     * 
     * @param id
     * @param oldStatus
     * @param newStatus
     * @param updateTime
     * @return
     */
    public int updateStatus(long id, RewardRedPacketStatus oldStatus, RewardRedPacketStatus newStatus, Date updateTime);

    /**
     * 根据用户和状态获取红包
     * 
     * @param status
     * @param userName
     * @return
     */
    public List<RewardRedpacket> findRedPacketByStatusAndUser(RewardRedPacketStatus status, String userName);

}
